import { resCaptcha, resSendEmailCode, resSendSmsCode } from '@/services/auth';
import { useRequest } from 'ahooks';

export const useCaptchaApi = () => {
  const { data, run, loading } = useRequest(resCaptcha);
  return { data, run, loading };
};

export const useSendSmsApi = () => {
  const { data, runAsync, loading } = useRequest(resSendSmsCode, {
    manual: true,
  });
  return { data, runAsync, loading };
};

export const useSendEmailApi = () => {
  const { data, runAsync, loading } = useRequest(resSendEmailCode, {
    manual: true,
  });
  return { data, runAsync, loading };
};
